package Object类编程题;

public class Phone {
    private String brand;
    private String color;
    private double price;

    public Phone(String brand, String color, double price) {
        this.brand = brand;
        this.color = color;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "brand='" + brand + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                '}';
    }
}
class TestPhone{
    public static void main(String[] args) {
        Phone p1 = new Phone("华为","白色",4999);
        Phone p2 = new Phone("苹果","黑色",7999);
        System.out.println(p1);
        System.out.println(p2);
    }
}
